﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dukou.Dao;
using Dukou.Domain;

namespace Dukou.BizService
{
    public interface IBizService<D, T, TId>
        where D : INHibernateDao<T, TId>
        where T : IEntity<TId>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T FindById(TId id);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IList<T> SelectAll();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        TId Save(T entity);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        void SaveOrUpdate(T entity);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        void Update(T entity);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        void Delete(T entity);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="id"></param>
        void Delete(Type type, TId id);
    }
}
